<?php

namespace apiend\modules\setting\models;

use Yii;
use common\helpers\Url;
use common\models\work\CompanyDepartment;

/**
 * 品牌设置模型
 * 
 * @author emhome <emhome@163.com>
 * @since 1.0
 */
class DepartmentForm extends CompanyDepartment {

    /**
     * @inheritdoc
     */
    public function typecastAttributes() {
        return [
//            parent::EVENT_BEFORE_VALIDATE => [
//                [
//                    'attributes' => ['thumb', 'banner', 'logo'],
//                    'type' => function ($event, $attribute) {
//                        return Url::relativePath($this->$attribute);
//                    },
//                ],
//            ],
//            parent::EVENT_AFTER_FIND => [
//                [
//                    'attributes' => ['thumb', 'banner', 'logo'],
//                    'type' => function ($event, $attribute) {
//                        return Url::attach($this->$attribute);
//                    },
//                ],
//            ]
        ];
    }

}
